
var LOADING_SMALL ='<img id="loading-small" src="..images/loading-small.gif" />';

function addUserAdmin(){
	alert('LOL');
	userGroupID=document.getElementById('userGroupID').value;
	email=document.getElementById('email').value;
	password=document.getElementById('password').value;
	f_name=document.getElementById('f_name').value;
	l_name=document.getElementById('l_name').value;
	phone=document.getElementById('phone').value;
	check=true;
	if(check==true){
		f_name	=	ecodeURIComponent(f_name);
		l_name	=	ecodeURIComponent(l_name);
		pos		=	"loading";
		loading	=	"submit-loading";
		if(xmlHttp==null){
			alert("You're Browser does not support AJAX");
			return;
		}
		var url="../controllers/controllers-user-admin.php?action=add-Admin&userGroupID="
		+userGroupID+"&email="+email+"&password="+password+"&f_name="+f_name+"&l_name="+l_name+"&phone="+phone;
		url=url+"&id"+Math.random();
		
		xmlHttp.onreadystatechange=function(){
			document.getElementById('loading').innerHTML=LOADING_SMALL;
			if(xmlHttp.readyState==4||xmlHttp.readyState=="complete"){
				document.getElementById(pos).innerHTML=xmlHttp.responseText;
				document.getElementById(loading)="";
			}			
		};
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
		alert('3');
	}
	
}



var xmlHttp;
function GetXmlHttpObject(){
	var xmlHttp=null;
	try{
		xmlHttp=new XMLHttpRequest();
	}
	catch(e){
		try{
		xmlHttp=new ActiveXObject("Msxm12.XMLHTTP");
		}catch(e){
		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}